<?php
$months = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
    "Oct", "Nov", "Dec");
ini_set("date.timezone", "Europe/Paris");

$this_day = now();
$pattern = "%Y";
$str_year = mdate($pattern, $this_day);

for ($i = 0; $i < 12; $i++) {
    $dropdown_data[$i + 1] = $months[$i];
}
for ($i = 0; $i < 31; $i++) {
    $day_data[$i + 1] = $i + 1;
}
for ($i = $str_year; $i > 1900; $i--) {
    $year_data[$i] = $i;
}

$selected_region_setting = array(
        'table_name' => 'animus_sub_region',
        'key_field' => 'id',
        'value_field' => 'name',
    );

?>

<div id="wrapper-content">
    <table class="titrepage" width="100%">
        <tr>
            <td > Ajouter nouveau gardien</td>
        </tr>
    </table>
        <?php echo form_open_multipart('seatting_admin/add_gardient')?>
        <div id="register" align="center">
          
            <table class="list" width="100%"  cellpadding="10px" cellspacing="0">
                <tr>
                    <td><label for="gardient_name">Gardien name <font color="red">*</font></label></td>
                    <td><input type="text" name="gardient_name" value="<?php echo set_value('gardient_name'); ?>" id="gardient_name"/></td>
                    <td><?php echo form_error('gardient_name')?></td>
                </tr>
                <tr>
                    <td><label for="password">Password <font color="red">*</font></label></td>
                    <td><input type="password" name="password"/></td>
                    <td><?php echo form_error('password')?></td>
                </tr>
                <tr>
                    <td><label for="confirm_pass">Confirm Password <font color="red">*</font></label></td>
                    <td><input type="password" name="confirm_pass"/></td>
                    <td><?php echo form_error('confirm_pass')?></td>
                </tr>
                <tr>
                    <td><label for="first_name">First name <font color="red">*</font></label></td>
                    <td><input type="text" name="first_name" id="first_name" value="<?php echo set_value('first_name'); ?>"/></td>
                    <td><?php echo form_error('first_name')?></td>
                </tr>
                <tr>
                    <td><label for="last_name">Last name <font color="red">*</font></label></td>
                    <td><input type="text" name="last_name" id="last_name" value="<?php echo set_value('last_name'); ?>"/></td>
                    <td><?php echo form_error('last_name')?></td>
                </tr>
                <tr>
                    <td><label for="email">Email <font color="red">*</font></label></td>
                    <td><input type="text" name="email" value="<?php echo set_value('email'); ?>"/></td>
                    <td><?php echo form_error('email')?></td>
                </tr>
                <tr>
                    <td><label >Picture:</label></td>
                    <td><input type="file" name="userfile" id="userfile" size="25"/></td>
                </tr>
                <tr>
                    <td><label for="experience">Experience <font color="red">*</font></label></td>
                    <td><input type="text" name="experience" id="company" value="<?php echo set_value('experience'); ?>"/></td>
                    <td><?php echo form_error('experience')?></td>
                </tr>
                <tr>
                    <td><label for="dob">Date of birth</label></td>
                    <td>
                        D : <?php echo form_dropdown('birth_date', $day_data, 1, 'id="day"'); ?>
                        M : <?php echo form_dropdown('birth_month', $dropdown_data, 1, 'id="month"'); ?>
                        Y : <?php echo form_dropdown('birth_year', $year_data, $str_year, 'id="year"'); ?>
                    </td>
                </tr>
                <tr>
                    <td><label for="gender">Gender</label></td>
                    <td>
                    <?php
                    $male = array(
                        'name' => 'gender',
                        'id' => 'rad_male',
                        'value' => 'm',
                        'checked' => TRUE,
                        'style' => 'margin:10px',
                    );
                    $female = array(
                        'name' => 'gender',
                        'id' => 'rad_female',
                        'value' => 'f',
                        'checked' => FALSE,
                        'style' => 'margin:10px',
                    );

                    echo 'Male' . form_radio($male);
                    echo 'Female' . form_radio($female, 'Female');
                    ?>
                </td>
                </tr>
                <tr>
                    <td><label for="phone">Phone</label></td>
                    <td><input type="text" name="phone" id="phone" value="<?php echo set_value('phone'); ?>"/></td>
                    <td><?php echo form_error('phone')?></td>
                </tr>
                <tr>
                    <td><label for="address">Address <font color="red">*</font></label></td>
                    <td><input type="text" name="address" id="address" value="<?php echo set_value('address'); ?>"/></td>
                    <td><?php echo form_error('address')?></td>
                </tr>
                <tr>
                    <td><label for="post_code">Post code<font color="red">*</font></label></td>
                    <td><input type="text" name="post_code" id="phone" value="<?php echo set_value('post_code'); ?>"/></td>
                    <td><?php echo form_error('post_code')?></td>
                </tr>
                <tr>
                    <td><label for="city">City <font color="red">*</font></label></td>
                    <td><?php echo form_dropdown('city',dropdown_data($selected_region_setting),01,'style="width:150px;"')?></td>
                    <td><?php echo form_error('city')?></td>
                </tr>
                <tr>
                    <td></td>  <td><input type="submit" name="submit" id="submit" value=" Ajouter "/></td>
                </tr>
            </table>
        </div>
        <?php echo form_close() ?>
    </form>
</div>